<ul class="navbar-nav">
    <li class="nav-item">
      <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
    </li>
    <li class="nav-item d-none d-sm-inline-block" >
      <a data-url="pages/Admin/index/index.html" class="nav-link" id="homepage">主页</a>
    </li>
    
</ul>
<ul class="navbar-nav ml-auto">
  <li class="nav-item d-none d-sm-inline-block">
    <a data-url="pages/Admin/admin_login.html" class="nav-link" id="logOut">退出登录</a>
  </li>
</ul>
<script>
 function getContextPath() {
        var curWwwPath = document.location.href;
        var pathName = document.location.pathname;     
        var pos = curWwwPath.indexOf(pathName);
        var localhostPath = curWwwPath.substring(0,pos);
        return localhostPath;
        // return "C:\\Users\\zhuoQiang\\Desktop\\web\\proj"
    }
  $("#homepage").attr("href",getContextPath() + "\/"+  $("#homepage").data("url"))
  $("#logOut").attr("href",getContextPath() + "\/"+  $("#logOut").data("url"))
</script>